<?php
namespace app\home\controller;
   class Entry extends common{
       public function  index(){
           $headConf=['title'=>'个人博客首页'];
           View::with('headConf',$headConf);
           //获取文章相关项
           $articleData=Db::table('article')
               ->join('category','category_cid','=','cid')
               ->get(['aid','title','author','sendtime','cname','thumb','digest']);
           foreach( $articleData as $k=>$v){
               $articleData[$k]['tags']=Db::table('tag')
                   ->join('article_tag','tid','=','tag_tid')
                   ->where('article_aid',$v['aid'])->lists('tid,tname');
           }
           View::with('articleData',$articleData);
           return view();
       }
   }
